<template>
	<view style="padding-top: 30upx;">
		<ss-select-city
		  v-model="value"
		  :hot-citys="hotCitys"
		  @on-select="City"
		/>
		<view class="btn" @click="getcity()">确定</view>
	</view>
</template>

<script>
	import ssSelectCity from '@/components/ss-select-city/index.vue'
	export default {
	  data() {
	    return {
	      hotCitys: [
	        '杭州',
	        '天津',
	        '北京',
	        '上海',
	        '深圳',
	        '广州',
	        '成都',
	        '重庆',
	        '厦门'
	      ],
	      value: '杭州'
	    }
	  },
	  components: {
	    ssSelectCity
	  },
	  onLoad(e) {
	  	this.value = e.city
	  },
	  methods: {
	    City(city) {
			
	      console.log(city)
	    },
		getcity () {
			console.log('1111')
			// uni.navigateTo({
			// 	url:'/pages/city_page/index?city=' + this.city
			// })
			// uni.navigateBack({
			// 	delta: 1
			// })
			if (this.value.indexOf('市') == -1) {
			
				uni.setStorageSync('city', this.value + '市')
			} 
			uni.switchTab({
				url:'/pages/index/index'
			})
		}
	  }
	}
</script>

<style>
	.btn{
		width: 100%;
		height: 90upx;
		background-color: #FFD103;
		border-radius: 10upx;
		text-align: center;
		line-height: 90upx;
		font-size: 33upx;
		margin-top: 70upx;
		letter-spacing: 2upx;
		position: fixed;
		bottom: 40upx;
		color: #FFFFFF;
	}
</style>
